package ar.com.huargo.easyio.io;

import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;

public class FileWriter {

	protected String filename;
	
	private File file;
	
	private BufferedWriter bw;
	
	
	public FileWriter(String filename){
		super();
		this.filename = filename;
	}
	
	public void create() throws IOException{
		this.file = new File(this.filename);
		this.bw = new BufferedWriter(new java.io.FileWriter(this.file));
	}
	
	public void write(String string) throws IOException{
		this.bw.write(string);
	}
	
	public void writeLn(String string) throws IOException{
		this.write(string);
		this.bw.newLine();
	}
	
	public void close() throws IOException{
		this.bw.close();
		this.file = null;
	}

}


